Repository navigation
Remove upper option from CholeskyCorrTransform - #8653
Conversation
…r factor backward() padded the filled block for the lower case only, so upper=True returned a lower-triangular factor with the correlations in the strictly lower part. forward() sliced the wrong sub-block for the upper case, and log_jac_det used the lower-case row weights. All three now depend on upper, and the upper-case tests cover forward, backward, round-trip, log_jac_det against autodiff, and valid correlation factors. Fixes pymc-devs#8555
|
|
|
Just remove the option, nobody has asked for it |
|
Updated per @ricardoV94's review: the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8653 +/- ##
==========================================
+ Coverage 92.21% 92.24% +0.03%
==========================================
Files 129 130 +1
Lines 21567 21743 +176
==========================================
+ Hits 19887 20056 +169
- Misses 1680 1687 +7
🚀 New features to boost your workflow:
|


Description
Per @ricardoV94's review, the
upperoption is removed instead of fixed: nobody asked for it, andCholeskyCorrTransform's only internal use, inLKJCorr, always uses the lower-triangular factor.CholeskyCorrTransformnow takes onlynand always returns a lower-triangular factor.Changes:
upperparameter and all upper branches fromforward,backward,log_jac_det,_fill_triangular_spiraland_inverse_fill_triangular_spiralinpymc/distributions/transforms.py.pymc/distributions/multivariate.pynow callsCholeskyCorrTransform(n=n).Prepared with AI assistance (Muse).
Related Issue
Checklist
No new documentation was needed: the transform docstring no longer mentions
upper.Type of change
Tests run
python -m pytest tests/distributions/test_transform.py: 76 passed, with 1 pre-existing failure intest_invalid_jacobian_broadcast_raisesthat fails the same way on unmodified main and passes in isolation.python -m pytest tests/distributions/test_multivariate.py -k lkjcorr: 18 passed.ruff format --checkpasses on all three files.